﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="QuoteDiscuss.aspx.vb" Inherits="helzwebscripting.QuoteDiscuss" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h1 class="bigHeadings">Twilighters Community Quotes</h1>  
    <p>
        <br />
        <asp:GridView ID="quoteDiscussGV" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ID" DataSourceID="SqlDataSource1" AlternatingRowStyle-CssClass="altRowStyle" class="gridviewList"  >
<AlternatingRowStyle CssClass="altRowStyle"></AlternatingRowStyle>
            <Columns>
                <asp:BoundField DataField="Character" HeaderText="Character" 
                    SortExpression="Character" />
                <asp:BoundField DataField="Quote" HeaderText="Quote" SortExpression="Quote" />
                <asp:BoundField DataField="Book" HeaderText="Book" SortExpression="Book" />
                
             <asp:TemplateField HeaderText="TwiWriter">
            <ItemTemplate>
            <div style="word-wrap:break-word;">
                <span style="font-family: 'Milonga', Sans-Serif; font-size:12pt;">
                <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'>
                <%# Eval("TwiWriter")%></a></span><br />
            </div>
            </ItemTemplate>
            </asp:TemplateField>    
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
            ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
            SelectCommand="SELECT [Quote], [ID], [TwiWriter], [Character], [Book] FROM [Quotes] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
  
  <%--RATINGS--%>
        
        <span class="listviewLabel">TwiRating: rate this quote, Twilighter <asp:LoginName ID="LoginName1" runat="server" />
        <br />
        </span>
       
        
       
        <br />
    </p>
    <asp:Rating ID="Rating1" runat="server"
    BorderWidth="0"
    width="253px" 
    CurrentRating="2" 
    StarCssClass="ratingStar" 
    WaitingStarCssClass="savedRatingStar" 
    EmptyStarCssClass="emptyRatingStar" 
    filledStarCssClass="filledRatingStar"
    MaxRating="5" 
    >
    </asp:Rating><br /><br /><br />
    <asp:Button ID="Button1" runat="server" CssClass="addBtn" Text="Rate quote" />
    Your rating:
    <asp:Label ID="lbl_Rating" runat="server" Text=""></asp:Label>
    <br /><br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource2" GridLines="None">
        <Columns>
            <asp:BoundField DataField="AverageRating" 
                HeaderText="Average TwiRating:" ReadOnly="True" 
                SortExpression="AverageRating" ItemStyle-HorizontalAlign="Center" 
                DataFormatString="{0:f1}"  >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:BoundField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
        ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
        SelectCommand="SELECT [AverageRating], [QuoteFKID] FROM [AverageRatingView] WHERE ([QuoteFKID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="QuoteFKID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
&nbsp;<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
        <br />

            <hr />
                    <br />
        
<%--COMMENTS--%>

    <%# Eval("Timestamp")%>

    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="quoteCommentsDS" CssClass="commentsGV" 
        AlternatingRowStyle-CssClass="altRowStyle" AllowPaging="True" PagerStyle-CssClass="pager" PageSize="5">
        <Columns>
            <asp:TemplateField HeaderText="TwiWriter">
            <ItemTemplate>
            <div style="word-wrap:break-word;">
                <span style="font-family: 'Milonga', Sans-Serif; font-size:12pt;">
                <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'>
                <%# Eval("TwiWriter")%></a></span><br />
                <span style="font: Arial; font-size: 12pt;">at <%# Eval("Timestamp")%></span>
            <br />
            <div>
            <asp:Image id="commentsAvatar" runat="server" ImageUrl='<%# Eval("AvatarFK")%>' />
            </div>
            </div>
            </ItemTemplate>

            <AlternatingItemTemplate>
            <div style="word-wrap:break-word;">
            <span style="font-family: 'Milonga', Sans-Serif; font-size:12pt;">
                <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'>
                <%# Eval("TwiWriter")%></a></span><br />
                <span style="font: Arial; font-size: 12pt;">at <%# Eval("Timestamp")%></span>
             <br />
             <div class="avatarContainer">
            <asp:Image id="commentsAvatar" runat="server" ImageUrl='<%# Eval("AvatarFK")%>' CssClass="avatar" />
            </div>
            </div>
            </AlternatingItemTemplate>
            </asp:TemplateField>


            <asp:TemplateField HeaderText="Comments on this quote">
            <ItemTemplate>
            <div style="word-wrap:break-word;">
            <span style="font: Arial; font-size: 12pt;word-wrap:break-word;">
                <%# Eval("Comment")%></span>
            </div>
            </ItemTemplate>

            <AlternatingItemTemplate>
            <div style="word-wrap:break-word;">
            <span style="font: Arial; font-size: 12pt;word-wrap:break-word;">
                <%# Eval("Comment")%></span>
            </div>
            </AlternatingItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="quoteCommentsDS" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
        ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
        SelectCommand="SELECT [TwiWriter], [Comment], [AvatarFK], [Timestamp] FROM [QuoteComments] WHERE ([QuoteFKID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="QuoteFKID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br /><br />

 
    <div class="AddCommentDiv">
        <span class="listviewLabel">Add your comment Twilighter
        <asp:LoginName ID="LoginName2" runat="server" /></span>
        <br />
&nbsp;<asp:TextBox ID="tb_sceneComment" runat="server" Height="132px" 
            TextMode="MultiLine" Width="435px" Font-Names="Arial" Font-Size="12pt"></asp:TextBox>
        <br />
        <asp:Button ID="btn_quoteComment" runat="server" CssClass="addBtn" Text="Submit Comment" />
        <br />
        Please note that comments violating the <asp:HyperLink ID="HyperLink1" runat="server" Text="rules" Font-Size="11pt" NavigateUrl="~/About.aspx" />&nbsp;will 
        be removed.
    </div>







</asp:Content>
